package com.whately.core.base.constant;

import lombok.Getter;

/**
 * 加密方式
 */
@Getter
public enum PwdEncodeEnum {


    bcrypt(0,"bCrypt方式"),

    md5_twice(1,"2次md5"),

    ;


    Integer code;
    String text;

    private PwdEncodeEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }


    public static PwdEncodeEnum getByCode(Integer code){
        if(code==null){
            return null;
        }
        for(PwdEncodeEnum e:PwdEncodeEnum.values()){
            if(code.equals(e.code)){
                return e;
            }
        }
        return null;
    }

}
